import type { FormRules } from 'element-plus'
import { reactive } from 'vue'

export const RULE_LOGIN = reactive<FormRules>({ // 用户登录
  phone: [{
    required: true,
    message: '请输入手机号',
  }, {
    pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
    message: '手机号不正确',
  }],
  code: [{
    required: true,
    message: '请输入验证码',
  }, {
    len: 6,
    message: '验证码错误',
    trigger: 'blur'
  }],
})

export const RULE_COMP_PROJECT_BASIC_INFO = reactive<FormRules>({ // 比赛基本信息
  name: {
    required: true,
    message: '请输入项目名',
    trigger: 'blur',
  },
  compId: {
    required: true,
    message: '请输入参与的比赛名',
    trigger: 'blur',
  },
  awardLevel: {
    required: true,
    message: '请输入获奖等级',
    trigger: 'blur',
  },
  awardTime: {
    required: true,
    message: '请输入获奖时间',
    trigger: 'blur',
  },
  awardProveUrl: {
    required: true,
    message: '请上传获奖证明',
    trigger: 'blur',
  },
})
export const RULE_COURSE_DESIGN_BASIC_INFO = reactive<FormRules>({ // 比赛基本信息
  name: {
    required: true,
    message: '请输入项目名',
    trigger: 'blur',
  },
  courseType: {
    required: true,
    message: '请输入课程类型',
    trigger: 'blur',
  },
  courseId: {
    required: true,
    message: '请输入课程名',
    trigger: 'blur',
  },
})
export const RULE_FILE_SETTING = reactive<FormRules>({
  name: {
    required: true,
    message: '请输入文件名',
    trigger: 'blur',
  },
  price: {
    required: true,
    message: '请输入附件价格',
    trigger: 'blur',
  },
})

